import numpy as np
from model_utils import load_model_and_scaler, predict_next_n_hours

def generate_grid_price_data():
    hours = np.arange(24)
    np.random.seed(42)
    base = 0.5
    noise = np.random.normal(0, 0.02, size=24)
    data = base + 0.02 * np.sin(hours / 24 * 2 * np.pi) + noise
    return data.reshape(-1, 1)

if __name__ == "__main__":
    model_path = "saved_models/grid_price_lstm_model.pt"
    scaler_path = "saved_models/grid_price_scaler.pkl"

    model, scaler = load_model_and_scaler(model_path, scaler_path)
    input_data = generate_grid_price_data()

    print("模拟的grid_price 24小时输入数据：")
    print(input_data.flatten())

    preds = predict_next_n_hours(model, scaler, input_data)
    print("未来24小时grid_price预测值：")
    print(preds)
